package com.qf.controller;

import com.qf.pojo.response.BaseResult;
import com.qf.service.QueryConditionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/curse")
public class QueryConditionsController {

    @Autowired
    private QueryConditionsService queryConditionsService;

    @RequestMapping(value = "/findAllGrade", method = RequestMethod.GET)
    public BaseResult findAllGrade(){
        return queryConditionsService.findAllGrade();
    }


    @RequestMapping(value = "/findAllSubject", method = RequestMethod.GET)
    public BaseResult findAllSubject(@RequestParam("dengji") Integer id){
        return queryConditionsService.findAllSubject(id);
    }


    @RequestMapping(value = "/findMayCurse", method = RequestMethod.GET)
    public BaseResult findMayCurse(HttpServletRequest request){
        return queryConditionsService.findMayCurse(request);
    }
}
